<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ page import="org.springframework.web.servlet.i18n.CookieLocaleResolver,com.huatek.framework.util.SpringContext" %>
<script type="text/javascript">
var msg_delete_select='<spring:message code="operation.delete.select"/>';
var msg_delete_warn='<spring:message code="operation.delete.warn"/>';
var cannot_connect_server = '<spring:message code="error.connect.to.server"/>';
var local_message = '<%=((CookieLocaleResolver)SpringContext.getBean("localeResolver")).resolveLocale(request)%>';
</script>
<script src="js/jquery-1.5.1.min.js" type="text/javascript"></script>
<script src="js/ht_frame.js" type="text/javascript"></script>
<style>
.subMenu{
	display:none;
	margin:5px 0 0 15px;
}
ul.leftMenu{
	padding:0px 10px;
}
ul.leftMenu li.firstMenu{
	padding:5px 0;
}
ul.leftMenu a{
	color:black;
}
</style>
<script type="text/JavaScript">
$(document).ready(function(){
	$(".firstMenu").find("a:first").toggle(
			function(){$(this).parent().find(".subMenu").show();},
			function(){$(this).parent().find(".subMenu").hide();}
	);
	$(".subMenu li a").click(function(){
		$(".subMenu li a").css("color","black");
		$(this).css("color","blue");
	});
});
</script>

<div class="widget" style="margin-top: 10px;">
<div class="head">
<h5 class="iMoney"><b>当前数据角色名称：</b>
<c:out value="${efwDataRole.daName }" /></h5>
</div>
<div style="float: left; width: 22%; border-right: 1px solid #CCCCCC;padding-top: 15px;">
	${Menu}
</div>
<div style="float: right; width: 77%;" id="assignDataAuthority">
<p>请选择左边模块菜单</p>
</div>
<div style="clear: both;"></div>
</div>
<SCRIPT type="text/javascript">

function getAppearPart(id){
	getData('efwDataRole.do?actionMethod=getModuleAuthority','businessModuleId='+id,'assignDataAuthority');
}
function displayEntity(entityName, moduleId, entityId, params){
	if(document.getElementById("entity_"+entityId).style.display=='block'){
		$("#entity_"+entityId).attr("style","display:none;");
	}else{
		queryEntity(moduleId, entityId,params);
		$("#entity_"+entityId).attr("style","display:block;");
	}
}

function queryEntity(moduleId, entityId, params){
	var DataStr = $('#entityForm_'+entityId).serialize();
	DataStr +='&dataRoleId=${efwDataRole.id}&businessModuleId='+moduleId+'&'+params+'&entityId='+entityId;
	var displayDiv = entityId;
	postDataByURL('efwDataRole.do?actionMethod=queryDataEntity',DataStr,"entity_"+entityId);

}

function displayField(entityName,moduleId,entityId, params){
	if(document.getElementById("entity_"+entityId).style.display=='block'){
		$("#entity_"+entityId).attr("style","display:none;");
	}else{
		queryField(moduleId, entityId, params);
		$("#entity_"+entityId).attr("style","display:block;");
	}
}

function queryField(moduleId, entityId, params){
	var DataStr = 'dataRoleId=${efwDataRole.id}&businessModuleId='+moduleId+'&entityId='+entityId+'&categoryCode='+params;
	var displayDiv = entityId;
	postDataByURL('efwDataRole.do?actionMethod=getFieldDataAuthority',DataStr,"entity_"+entityId);

}

function assignData(moduleId,checkObj, entityId, fieldValue){

	var dataStr = 'dataRoleId=${efwDataRole.id}&businessModuleId='+moduleId+'&dataId='+checkObj.value+"&checked="+checkObj.checked+"&entityId="+entityId;
	if(fieldValue){
		dataStr+='&fieldValue='+fieldValue;
	}else{
		dataStr+='&fieldValue='+checkObj.value;
	}
	switchData('efwDataRole.do?actionMethod=assignDataAuthority',dataStr);
}
$(document).ready(function() {
	$("#moduleList tr").click(function(){
		$("#moduleList").find("tr").each(function(){
			$(this).attr("style","background-color:;font-weight:");
			});
    	$(this).attr("style","background-color:#ccc;font-weight:normal");
	});
});

</SCRIPT>